/* 个人中心页面样式 */

/* 用户信息卡片 */
.user-avatar {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #16a34a;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-edit:hover {
    background: #15803d;
    transform: scale(1.1);
}

.avatar-edit i {
    font-size: 10px;
    color: white;
}

/* 会员等级卡片 */
.vip-card {
    background: linear-gradient(135deg, #16a34a 0%, #2563eb 100%);
    border-radius: 16px;
    padding: 16px;
    color: white;
    position: relative;
    overflow: hidden;
}

.vip-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: vipGlow 3s ease-in-out infinite;
}

@keyframes vipGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.vip-level {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.vip-expiry {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

.vip-progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.vip-progress-bar {
    background: white;
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 徽章展示 */
.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 12px;
}

.badge-item:hover {
    background: #f8fafc;
    transform: translateY(-2px);
}

.badge-item.earned .badge-icon {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.badge-item:not(.earned) .badge-icon {
    background: #e5e7eb;
}

.badge-item:not(.earned) .badge-icon i {
    color: #9ca3af;
}

.badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.badge-icon i {
    font-size: 20px;
    color: white;
}

.badge-item span {
    font-size: 10px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.2;
}

.badge-item.earned span {
    color: #16a34a;
    font-weight: 600;
}

/* 菜单项 */
.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.menu-item:hover {
    background: #f8fafc;
}

.menu-item:active {
    background: #e2e8f0;
}

.menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-icon i {
    font-size: 18px;
}

.menu-item:hover .menu-icon {
    transform: scale(1.1);
}

.cart-count, .coupon-count {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* 最近活动 */
.activity-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.activity-icon i {
    font-size: 16px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content p:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.activity-points {
    text-align: right;
    flex-shrink: 0;
}

/* 状态栏 */
.status-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* 底部导航 */
.fixed.bottom-0 {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

/* 按钮点击效果 */
button, .menu-item, .badge-item {
    transition: all 0.2s ease;
}

button:active, .menu-item:active, .badge-item:active {
    transform: scale(0.95);
}

/* 渐变背景 */
.bg-gradient-to-br {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
}

/* 卡片阴影 */
.shadow-sm {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* 响应式设计 */
@media (max-height: 800px) {
    .user-avatar {
        width: 56px;
        height: 56px;
    }
    
    .menu-item {
        padding: 12px 16px;
    }
    
    .badge-icon {
        width: 40px;
        height: 40px;
    }
    
    .badge-icon i {
        font-size: 16px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* 加载动画 */
.loading-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 成功提示 */
.success-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 500;
    z-index: 1000;
    animation: successFade 2s ease-out forwards;
}

@keyframes successFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* 徽章详情模态框 */
.badge-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.badge-modal.hidden {
    display: none;
}

.badge-modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.3);
}

.badge-modal-icon i {
    font-size: 32px;
    color: white;
}

.badge-modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.badge-modal-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

.badge-modal-date {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.badge-modal-close {
    background: #16a34a;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.badge-modal-close:hover {
    background: #15803d;
    transform: translateY(-1px);
}

/* 设置按钮动画 */
.settings-btn {
    transition: all 0.3s ease;
}

.settings-btn:hover {
    transform: rotate(90deg);
}

/* 通知按钮动画 */
.notification-btn {
    position: relative;
    transition: all 0.3s ease;
}

.notification-btn:hover {
    animation: bellRing 0.5s ease-in-out;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.notification-btn::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}